<?php namespace Cms\Controller;

/**
 * 后台首页
 */
class IndexController extends AuthController
{
    //后台首页
    public function index()
    {
        //获取顶部菜单
        $topMenu = Api('Menu/getTopMenu');
        //获取后台左侧子菜单
        $menu = Api('Menu/getLeftMenu');

        //菜单图标
        $icon=array(
            'fa-table','fa-bar-chart-o','fa-th-large','fa-desktop','fa-edit','fa-file-text-o'
            );
        View::with('menu',$menu)->with('topMenu',$topMenu)->with('icon',$icon);
        View::make();
    }

    //欢迎页
    public function welcome()
    {
        //首次登录时更新缓存
        $this->display();
        if (!F('model'))
        {
            go(U('Cache/index'));
        }
    }
}